package com.example.study.model;

import com.example.study.model.group.Insert;
import com.example.study.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@EqualsAndHashCode()
@Data
public class StudentVO implements Serializable {

    @NotNull(groups = {Update.class}, message = "学生ID不能为空")
    @ApiModelProperty(value = "学生ID")
    private Long id;
//    @NotBlank(groups = {Insert.class}, message = "学生学号不能为空")
//    @ApiModelProperty(value = "学生学号")
//    private String studentCode;
    @NotBlank(groups = {Insert.class}, message = "学生姓名不能为空")
    @Min(value = 2, message = "学生姓名不能小于2字符")
    @Max(value = 10, message = "学生姓名不能大于10个字符")
    @ApiModelProperty(value = "学生姓名")
    private String studentName;
    @NotNull(groups = {Insert.class}, message = "学生性别不能为空")
    @ApiModelProperty(value = "学生性别")
    private int studentSex;
    @NotNull(groups = {Insert.class}, message = "学生年龄不能为空")
    @Min(value = 1, message = "学生年龄不能小于1岁")
    @Max(value = 100, message = "学生年龄不能大于100岁")
    @ApiModelProperty(value = "学生年龄")
    private int studentAge;
    @NotNull(groups = {Insert.class}, message = "学生班级不能为空")
    @ApiModelProperty(value = "学生所在班级ID")
    private Long classId;
    @ApiModelProperty(value = "学生状态")
    private int status;
}
